06. Program the trading strategy
PRDTM2-787 AI Trading C4 L3 Vid6 Program The Trading Strategy
Overview of Programming a Trading Strategy
The focus is on building a trading strategy using the Geometric Brownian Motion (GBM) model. Here’s a simplified breakdown:
Class Structure
- GBM Class: Serves as the foundation of the strategy.
- Initialization (
__init__function): Establishes three primary variables:- Mu: Represents momentum or drift.
- Sigma: Indicates volatility.
- RNG: A random number generator for simulating model trajectories.
Functions
Calibrate Function:
- Takes parameters: trajectory (time series in a numpy array) and dt (time increment).
- Converts the trajectory to a logarithmic format and computes differences.
- Calculates average and standard deviation using bootstrapping to increase accuracy.
- Utilizes these to estimate parameters Mu and Sigma.
Forecast Function: Mentioned as the next focus to predict future stock prices.
The explanation centers on creating reliable estimates for GBM model parameters, preparing for future predictive tasks.